﻿// -----------------------------------------------------------------------
// <copyright file="Stack.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace DataStructures___Exc1
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Stack
    {
        LinkedList m_list;

        public Stack()
        {
            m_list = new LinkedList();
        }

        public bool IsEmpty()
        {
            return m_list.IsEmpty();
        }

        public void MakeEmpty()
        {
            m_list.MakeEmpty();
        }

        public void Push(ItemType i_item)
        {
            m_list.AddAtBeginning(i_item);
        }

        public ItemType Pop()
        {
            ItemType itemTypeToReturn = new ItemType();
            itemTypeToReturn = m_list.GetHeadFromList();
            m_list.RemoveFromBeginning();
            return itemTypeToReturn;
        }
    }
}
